package com.dyc.maitaole.controller;

import com.dyc.maitaole.entity.Good;
import com.dyc.maitaole.service.GoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;


@Controller
@RequestMapping("/pinggu")
public class GoodController {

    @Autowired
    private GoodService goodService;

    @RequestMapping("/goods")
    public ModelAndView findGoodById(Integer goodId){
        Good good = goodService.findGood(goodId);
        ModelAndView modelAndView = new ModelAndView("/assess.jsp");
        modelAndView.addObject("good",good);
        return modelAndView;
    }
}
